﻿using System;

namespace 简单工厂设计模式
{
    public  class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入你想要的笔记本品牌");
            string brand = Console.ReadLine();
            NoteBook nb = Yao(brand);
            nb.SayHello();
        }
        public static NoteBook Yao(string brand)
        {
            NoteBook nb = null;
            switch (brand)
            {
                case "Lenovo":
                    nb = new Lenovo();
                    break;
                case "IBM":
                    nb = new IBM();
                    break;
                case "Acer":
                    nb = new Acer();
                    break;
                case "Dell":
                    nb = new Dell();
                    break;

            }
            return nb;
        }
    }
    
}
